<template>
  
      <div class="cell"  @click="clickFn">
          <div class="left">{{title}}</div>
          <div class="right">{{value}} <i class="iconfont iconjiantou1"></i></div>
      </div>
  
</template>

<script>
export default {
props:{
    title:String,
      value:String,
      to:String,
},
 methods: {
    clickFn(e) {
      // console.log("你居然点击了子组件");
      // 如果父组件传递了 to 属性，就根据 to 属性跳转路由
      if (this.to) this.$router.push({ path: this.to });
      // 预留给父组件也能添加点击事件
      this.$emit("click", e);
    },
  },

}
</script>

<style lang="less" scoped>
.cell{
    height: 50px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
</style>